package com.icss.flow.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 元数据实体字段表(TMetaField)实体类
 *
 * @author makejava
 * @since 2024-01-30 13:05:58
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TMetaField implements Serializable {
    private static final long serialVersionUID = 260973166617998595L;

    @TableId(type = IdType.AUTO)
    private Integer autoId;

    private String fieldId;

    private Integer entityCode;

    private String name;

    private String label;

    public TMetaField(String fieldId, Integer entityCode,
                      String name, String label, String physicalName,
                      String type, Integer nullable,
                      Integer creatable, Integer updatable, Integer idFieldFlag,
                      Integer nameFieldFlag, Integer mainDetailFieldFlag,
                      Integer defaultMemberOfListFlag, String referTo) {
        this.fieldId = fieldId;
        this.entityCode = entityCode;
        this.name = name;
        this.label = label;
        this.physicalName = physicalName;
        this.type = type;
        this.nullable = nullable;
        this.creatable = creatable;
        this.updatable = updatable;
        this.idFieldFlag = idFieldFlag;
        this.nameFieldFlag = nameFieldFlag;
        this.mainDetailFieldFlag = mainDetailFieldFlag;
        this.defaultMemberOfListFlag = defaultMemberOfListFlag;
        this.referTo = referTo;
    }

    private String physicalName;

    private String type;

    private String description;

    private Integer displayOrder;

    private Integer nullable;

    private Integer creatable;

    private Integer updatable;

    private Integer idFieldFlag;

    private Integer nameFieldFlag;

    private Integer mainDetailFieldFlag;

    private Integer defaultMemberOfListFlag;

    private String referTo;

    private String referenceSetting;

    private String fieldViewModel;

    @TableLogic
    private Integer deleted;


    @TableField(exist = false)
    private TMetaEntity owner;


    //字段类型sql
    @TableField(exist = false)
    private String typeSql;


    @TableField(exist = false)
    private String oldTypeSql;

}

